* Merge ctb, staircase, self-stated measures of time and risk preferences
* to prepare data for analysis
* Load data
use "$data/variables_foranalysis", clear

*use "$data/03-1data.dta", clear
order responseid
sort responseid

* Merge with CTB individual-level estimates
use "$user/02 Data/variables_foranalysis", clear
merge 1:1 responseid using "$user/02 Data/ctb_ind", nogen

* Merge with staircase measures
merge 1:1 responseid using "$data/timerisk_sc_formerge.dta", nogen

compress
save "$data/ctb_maindata.dta", replace
clear

* Merge long data used for CTB estimation with individual covariates data
use "$data/ctbdata_estimation", replace

merge m:1 responseid using "$user/02 Data/variables_foranalysis"
save "$user/02 Data/ctb_with_ind_cov.dta", replace
